module.exports = function (myTemplateContents, compileFolderName) {

  // 处理div
  myTemplateContents = myTemplateContents.replace(/(<\s*\/?\s*)div(\s*([^>]*)?\s*>)/g, '$1view$2')

  // // 处理ref
  // let refRegexp = /(ref=".+")([^>]*>)/g
  //
  // // https://regexr.com/4de8c
  // myTemplateContents = myTemplateContents.replace(refRegexp, function(match, $1, $2) {
  //   return $1 + ' binding="$" ' + $2
  // })

  if (compileFolderName == 'pages') {
    myTemplateContents = `<import src="../../static/app.wxml" />
<include src="../../static/header.wxml" />

${myTemplateContents}

<include src="../../static/footer.wxml" />
`;
  } else {
    myTemplateContents = `<import src="../../static/app.wxml" />
${myTemplateContents}
`;
  }

  return myTemplateContents
}
